import {createRouter, createWebHistory} from 'vue-router'
import login from '../views/login.vue'
import type {RouterOptions} from 'vue-router'

const router = createRouter({
    history: createWebHistory(import.meta.env.BASE_URL),
    routes: [
        {
            path: '/',
            name: 'login',
            component: login
        },
        {
            path: '/message',
            name: 'message',
            component: import('../views/message.vue')
        },
        {
            path: '/index', //  /about/cart
            name: 'index',
            component: () => import('../views/index.vue'),
            children: [
                {
                    path: '/system/user',
                    name: 'system_user',
                    component: import('../views/system/user.vue'),
                },
                {
                    path: '/system/role',
                    name: 'system_role',
                    component: import('../views/system/role.vue'),
                },
                {
                    path: '/system/menu',
                    name: 'system_menu',
                    component: import('../views/system/menu.vue'),
                },
            ]
        }
    ]
} as RouterOptions)

export default router
